<template>
  <div class="dispatch-list-table">
    <dv-scroll-board :config="config" class="table" style="height:28vh" />
  </div>
</template>

<script>
// import moment from 'moment'
import {getMoldEquipUserApi} from '../../../api/product/index.js'
export default {
  name: '',
  data() {
    return {
      config: {
        // equipName zhuUserName fuUserName
        header: ['设备','机长', '日期','班次' ,'辅助工',],
        headerHeight: 20,
        data: [],
        index: false,
        columnWidth: [150,100,120,100],
        align: ['left'],
        headerBGC: ' ',
        oddRowBGC: ' ',
        evenRowBGC: 'rgba(52,99,171,0.15)',
        waitTime: '5000',
        rowNum: 10,
      },
      dataList: [],
    }
  },
  props: {
  },
  mounted() {
    this.getData()
  },
  methods: {
    getData() {
      const _that = this
      getMoldEquipUserApi({pkCorp: 1002}).then(res => {
        console.log('getMoldEquipUserApi',res)
        const {code,data} = res
        if(code === 2000) {
          _that.dataList = data
          const mConfig = {..._that.config}
          mConfig['data'] = []
          data.forEach(mData => {
            const m = []
            m.push(mData.equipName)
            m.push(mData.zhuUserName)
            m.push(mData.banciDate)
            m.push(mData.banciName)
            // banciDate banciName
            m.push(mData.fuUserName)
            // m.push(`<span style="font-size: 12px;">${mData.dispatchCode}</span>`)
            // m.push(`<span style="font-size: 12px;">${mData.invname}</span>`)
            // m.push(mData.dispatchQty)
            // m.push(mData.reportQty)
            // if(Number(mData.wanChengLv) >= 80) {
            //   m.push(`<label style="color:#13ce66;font-size: 18px">${mData.wanChengLv}%</label>`)
            // }else if(Number(mData.wanChengLv) >= 60) {
            //   m.push(`<label style="color:#1890ff;font-size: 18px">${mData.wanChengLv}%</label>`)
            // }else {
            //   m.push(`<label style="color:#ff4d4f;font-size: 18px">${mData.wanChengLv}%</label>`)

            // }
            // m.push(mData.wanChengLv + '%')
            mConfig.data.push(m)
          });
          _that.config = mConfig
        }
      })
    },
  },
}
</script>

<style lang="less" scoped>
.table {
  .px2vw(padding-left, 10);
  .px2vw(padding-right, 10);
}
/deep/ .row-item{
    height: 28px !important;
    line-height: 28px !important;
}
.dispatch-list-table {
  /deep/ .row-item{
      height: 28px !important;
      line-height: 28px !important;
      // font-size: 12px !important;
  }
}
</style>
